<template>
  <div class="content-box">
    <e-heading>发布服务</e-heading>
    <div class="center main_content">
      <img src="/static/images/cryface.jpg">
      <h1 class="tit main_color">发布课程需先设置校区</h1>
      <p><span class="red">{{second}}</span>秒后自动跳转到校区列表页面</p>
    </div>
    
  </div>
</template>

<script>
export default {
  computed: {
  },
  mounted () {
    this.timeOut()
  },
  data () {
    return {
      second: 3
    }
  },
  beforeDestroy () {
    clearTimeout(this.$timer)
  },
  methods: {
    timeOut () {
      let _this = this
      if (_this.second !== 0) {
        this.$timer = setTimeout(function () {
          _this.second--
          _this.timeOut(this.second)
        }, 1000)
      } else {
        this.$router.push({
          path: '/training/campus'
        })
      }
    }
  }
}
</script>

<style lang="scss" scoped>

.main_content{
  margin-top:150px;
  .red{
    color:#e40606;
  }
  p{
    color:#666;
  }
}
.tit{
  font-size:20px;
  margin: 25px 0 30px;
}
.main_color{
  color: $color-primary;
}

</style>
